/**
 * @copyright 2009-2022 Vanilla Forums Inc.
 * @license GPL-2.0-only
 */

import React from "react";

import { LayoutWidget } from "@library/layout/LayoutWidget";
import { RSSWidget } from "@library/rssWidget/RSSWidget";
import RSS_PLACEHOLDER_IMAGE from "@library/rssWidget/rssFeedPlaceholder.png";

interface IProps extends React.ComponentProps<typeof RSSWidget> {
    apiParams?: {
        fallbackImageUrl?: string;
    };
}

export function RSSWidgetPreview(props: IProps) {
    const placeholderRSSFeedItem = {
        description: "This content is generated by the linked RSS feed. You can’t update it here.",
        imageUrl: props.apiParams?.fallbackImageUrl ? props.apiParams?.fallbackImageUrl : RSS_PLACEHOLDER_IMAGE,
        name: "Title",
        to: "#",
    };
    return (
        <LayoutWidget>
            <RSSWidget {...props} itemData={[placeholderRSSFeedItem, placeholderRSSFeedItem, placeholderRSSFeedItem]} />
        </LayoutWidget>
    );
}
